home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
mnsbm.zip
/
MENUFORM.M
< prev
next >
Wrap
Text File
|
1989-10-31
|
1KB
|
45 lines
;**
;** menuform.m:
;**
;** An aid to pre-formatting menu files for use with the dialog manager.
;** Type <F10>menuform<Enter>, and you will be prompted for the number
;** of columns that will be visible in the finished menu window. The
;** text of the current buffer will be centered to fit.
;**
(macro menuform
(
(int button_offset
button_length
width
)
(string button
text
)
(get_parm 0 width "Number of visible columns: ")
(tabs 2)
(top_of_buffer)
(while (! (inq_position))
(
(= button_offset (index (= button (trim (ltrim (read)))) ";"))
(= text (ltrim (substr button (+ button_offset 1))))
(= button (trim (substr button 1 (- button_offset 1))))
(= button_length (strlen button))
(= button_offset (+ (/ (- width button_length) 2) 1))
(delete_to_eol)
(move_abs 0 button_offset)
(insert button)
(move_abs 0 (+ width 1))
(insert (+ ";" text))
(beginning_of_line)
(down)
)
)
(top_of_buffer)
(translate "\t" " " 1)
)
)